{
    "version": "0.3.5",
    "name": "org.apache.cordova.media-capture",
    "cordova_name": "Capture",
    "description": "Cordova Media Capture Plugin",
    "license": "Apache 2.0",
    "repo": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git",
    "issue": "https://issues.apache.org/jira/browse/CB/component/12320646",
    "keywords": [
        "cordova",
        "media",
        "capture"
    ],
    "platforms": [
        "android",
        "amazon-fireos",
        "ubuntu",
        "ios",
        "blackberry10",
        "wp7",
        "wp8",
        "windows8",
        "windows"
    ],
    "engines": [],
    "englishdoc": "<!---\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n-->\n\n# org.apache.cordova.media-capture\n\nThis plugin provides access to the device's audio, image, and video capture capabilities.\n\n__WARNING__: Collection and use of images, video, or\naudio from the device's camera or microphone raises important privacy\nissues.  Your app's privacy policy should discuss how the app uses\nsuch sensors and whether the data recorded is shared with any other\nparties.  In addition, if the app's use of the camera or microphone is\nnot apparent in the user interface, you should provide a just-in-time\nnotice before the app accesses the camera or microphone (if the\ndevice operating system doesn't do so already). That notice should\nprovide the same information noted above, as well as obtaining the\nuser's permission (e.g., by presenting choices for __OK__ and __No\nThanks__).  Note that some app marketplaces may require your app to\nprovide just-in-time notice and obtain permission from the user prior\nto accessing the camera or microphone.  For more information, please\nsee the Privacy Guide.\n\n## Installation\n\n    cordova plugin add org.apache.cordova.media-capture\n\n## Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n## Objects\n\n- Capture\n- CaptureAudioOptions\n- CaptureImageOptions\n- CaptureVideoOptions\n- CaptureCallback\n- CaptureErrorCB\n- ConfigurationData\n- MediaFile\n- MediaFileData\n\n## Methods\n\n- capture.captureAudio\n- capture.captureImage\n- capture.captureVideo\n- MediaFile.getFormatData\n\n## Properties\n\n- __supportedAudioModes__: The audio recording formats supported by the device. (ConfigurationData[])\n\n- __supportedImageModes__: The recording image sizes and formats supported by the device. (ConfigurationData[])\n\n- __supportedVideoModes__: The recording video resolutions and formats supported by the device. (ConfigurationData[])\n\n## capture.captureAudio\n\n> Start the audio recorder application and return information about captured audio clip files.\n\n    navigator.device.capture.captureAudio(\n        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture audio recordings using the\ndevice's default audio recording application.  The operation allows\nthe device user to capture multiple recordings in a single session.\n\nThe capture operation ends when either the user exits the audio\nrecording application, or the maximum number of recordings specified\nby `CaptureAudioOptions.limit` is reached.  If no `limit` parameter\nvalue is specified, it defaults to one (1), and the capture operation\nterminates after the user records a single audio clip.\n\nWhen the capture operation finishes, the `CaptureCallback` executes\nwith an array of `MediaFile` objects describing each captured audio\nclip file.  If the user terminates the operation before an audio clip\nis captured, the `CaptureErrorCallback` executes with a `CaptureError`\nobject, featuring the `CaptureError.CAPTURE_NO_MEDIA_FILES` error\ncode.\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start audio capture\n    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});\n\n### iOS Quirks\n\n- iOS does not have a default audio recording application, so a simple user interface is provided.\n\n### Windows Phone 7 and 8 Quirks\n\n- Windows Phone 7 does not have a default audio recording application, so a simple user interface is provided.\n\n## CaptureAudioOptions\n\n> Encapsulates audio capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of audio clips the device user can record in a single capture operation.  The value must be greater than or equal to 1 (defaults to 1).\n\n- __duration__: The maximum duration of an audio sound clip, in seconds.\n\n### Example\n\n    // limit capture operation to 3 media files, no longer than 10 seconds each\n    var options = { limit: 3, duration: 10 };\n\n    navigator.device.capture.captureAudio(captureSuccess, captureError, options);\n\n### Amazon Fire OS Quirks\n\n- The `duration` parameter is not supported.  Recording lengths cannot be limited programmatically.\n\n### Android Quirks\n\n- The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.\n\n### BlackBerry 10 Quirks\n\n- The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.\n- The `limit` parameter is not supported, so only one recording can be created for each invocation.\n\n### iOS Quirks\n\n- The `limit` parameter is not supported, so only one recording can be created for each invocation.\n\n## capture.captureImage\n\n> Start the camera application and return information about captured image files.\n\n    navigator.device.capture.captureImage(\n        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture images using the device's\ncamera application.  The operation allows users to capture more than\none image in a single session.\n\nThe capture operation ends either when the user closes the camera\napplication, or the maximum number of recordings specified by\n`CaptureAudioOptions.limit` is reached.  If no `limit` value is\nspecified, it defaults to one (1), and the capture operation\nterminates after the user captures a single image.\n\nWhen the capture operation finishes, it invokes the `CaptureCB`\ncallback with an array of `MediaFile` objects describing each captured\nimage file.  If the user terminates the operation before capturing an\nimage, the `CaptureErrorCB` callback executes with a `CaptureError`\nobject featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code.\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n### Windows Phone 7 Quirks\n\nInvoking the native camera application while your device is connected\nvia Zune does not work, and the error callback executes.\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start image capture\n    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});\n\n\n\n## CaptureImageOptions\n\n> Encapsulates image capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of images the user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).\n\n### Example\n\n    // limit capture operation to 3 images\n    var options = { limit: 3 };\n\n    navigator.device.capture.captureImage(captureSuccess, captureError, options);\n\n### iOS Quirks\n\n- The __limit__ parameter is not supported, and only one image is taken per invocation.\n\n## capture.captureVideo\n\n> Start the video recorder application and return information about captured video clip files.\n\n    navigator.device.capture.captureVideo(\n        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture video recordings using the\ndevice's video recording application.  The operation allows the user\nto capture more than one recordings in a single session.\n\nThe capture operation ends when either the user exits the video\nrecording application, or the maximum number of recordings specified\nby `CaptureVideoOptions.limit` is reached.  If no `limit` parameter\nvalue is specified, it defaults to one (1), and the capture operation\nterminates after the user records a single video clip.\n\nWhen the capture operation finishes, it the `CaptureCB` callback\nexecutes with an array of `MediaFile` objects describing each captured\nvideo clip file.  If the user terminates the operation before\ncapturing a video clip, the `CaptureErrorCB` callback executes with a\n`CaptureError` object featuring a\n`CaptureError.CAPTURE_NO_MEDIA_FILES` error code.\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start video capture\n    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});\n\n\n### BlackBerry 10 Quirks\n\n- Cordova for BlackBerry 10 attempts to launch the __Video Recorder__ application, provided by RIM, to capture video recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device.\n\n\n## CaptureVideoOptions\n\n> Encapsulates video capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of video clips the device's user can capture in a single capture operation.  The value must be greater than or equal to 1 (defaults to 1).\n\n- __duration__: The maximum duration of a video clip, in seconds.\n\n### Example\n\n    // limit capture operation to 3 video clips\n    var options = { limit: 3 };\n\n    navigator.device.capture.captureVideo(captureSuccess, captureError, options);\n\n### BlackBerry 10 Quirks\n\n- The __duration__ parameter is not supported, so the length of recordings can't be limited programmatically.\n\n### iOS Quirks\n\n- The __limit__ parameter is not supported.  Only one video is recorded per invocation.\n\n\n## CaptureCB\n\n> Invoked upon a successful media capture operation.\n\n    function captureSuccess( MediaFile[] mediaFiles ) { ... };\n\n### Description\n\nThis function executes after a successful capture operation completes.\nAt this point a media file has been captured, and either the user has\nexited the media capture application, or the capture limit has been\nreached.\n\nEach `MediaFile` object describes a captured media file.\n\n### Example\n\n    // capture callback\n    function captureSuccess(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n## CaptureError\n\n> Encapsulates the error code resulting from a failed media capture operation.\n\n### Properties\n\n- __code__: One of the pre-defined error codes listed below.\n\n### Constants\n\n- `CaptureError.CAPTURE_INTERNAL_ERR`: The camera or microphone failed to capture image or sound.\n\n- `CaptureError.CAPTURE_APPLICATION_BUSY`: The camera or audio capture application is currently serving another capture request.\n\n- `CaptureError.CAPTURE_INVALID_ARGUMENT`: Invalid use of the API (e.g., the value of `limit` is less than one).\n\n- `CaptureError.CAPTURE_NO_MEDIA_FILES`: The user exits the camera or audio capture application before capturing anything.\n\n- `CaptureError.CAPTURE_NOT_SUPPORTED`: The requested capture operation is not supported.\n\n## CaptureErrorCB\n\n> Invoked if an error occurs during a media capture operation.\n\n    function captureError( CaptureError error ) { ... };\n\n### Description\n\nThis function executes if an error occurs when trying to launch a\nmedia capture operation. Failure scenarios include when the capture\napplication is busy, a capture operation is already taking place, or\nthe user cancels the operation before any media files are captured.\n\nThis function executes with a `CaptureError` object containing an\nappropriate error `code`.\n\n### Example\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n## ConfigurationData\n\n> Encapsulates a set of media capture parameters that a device supports.\n\n### Description\n\nDescribes media capture modes supported by the device.  The\nconfiguration data includes the MIME type, and capture dimensions for\nvideo or image capture.\n\nThe MIME types should adhere to [RFC2046](http://www.ietf.org/rfc/rfc2046.txt).  Examples:\n\n- `video/3gpp`\n- `video/quicktime`\n- `image/jpeg`\n- `audio/amr`\n- `audio/wav`\n\n### Properties\n\n- __type__: The ASCII-encoded lowercase string representing the media type. (DOMString)\n\n- __height__: The height of the image or video in pixels.  The value is zero for sound clips. (Number)\n\n- __width__: The width of the image or video in pixels.  The value is zero for sound clips. (Number)\n\n### Example\n\n    // retrieve supported image modes\n    var imageModes = navigator.device.capture.supportedImageModes;\n\n    // Select mode that has the highest horizontal resolution\n    var width = 0;\n    var selectedmode;\n    for each (var mode in imageModes) {\n        if (mode.width > width) {\n            width = mode.width;\n            selectedmode = mode;\n        }\n    }\n\nNot supported by any platform.  All configuration data arrays are empty.\n\n## MediaFile.getFormatData\n\n> Retrieves format information about the media capture file.\n\n    mediaFile.getFormatData(\n        MediaFileDataSuccessCB successCallback,\n        [MediaFileDataErrorCB errorCallback]\n    );\n\n### Description\n\nThis function asynchronously attempts to retrieve the format\ninformation for the media file.  If successful, it invokes the\n`MediaFileDataSuccessCB` callback with a `MediaFileData` object.  If\nthe attempt fails, this function invokes the `MediaFileDataErrorCB`\ncallback.\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n### Amazon Fire OS Quirks\n\nThe API to access media file format information is limited, so not all\n`MediaFileData` properties are supported.\n\n### BlackBerry 10 Quirks\n\nDoes not provide an API for information about media files, so all\n`MediaFileData` objects return with default values.\n\n### Android Quirks\n\nThe API to access media file format information is limited, so not all\n`MediaFileData` properties are supported.\n\n### iOS Quirks\n\nThe API to access media file format information is limited, so not all\n`MediaFileData` properties are supported.\n\n## MediaFile\n\n> Encapsulates properties of a media capture file.\n\n### Properties\n\n- __name__: The name of the file, without path information. (DOMString)\n\n- __fullPath__: The full path of the file, including the name. (DOMString)\n\n- __type__: The file's mime type (DOMString)\n\n- __lastModifiedDate__: The date and time when the file was last modified. (Date)\n\n- __size__: The size of the file, in bytes. (Number)\n\n### Methods\n\n- __MediaFile.getFormatData__: Retrieves the format information of the media file.\n\n## MediaFileData\n\n> Encapsulates format information about a media file.\n\n### Properties\n\n- __codecs__: The actual format of the audio and video content. (DOMString)\n\n- __bitrate__: The average bitrate of the content.  The value is zero for images. (Number)\n\n- __height__: The height of the image or video in pixels. The value is zero for audio clips. (Number)\n\n- __width__: The width of the image or video in pixels. The value is zero for audio clips. (Number)\n\n- __duration__: The length of the video or sound clip in seconds. The value is zero for images. (Number)\n\n### BlackBerry 10 Quirks\n\nNo API provides format information for media files, so the\n`MediaFileData` object returned by `MediaFile.getFormatData` features\nthe following default values:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Not supported, and returns zero.\n\n- __height__: Not supported, and returns zero.\n\n- __width__: Not supported, and returns zero.\n\n- __duration__: Not supported, and returns zero.\n\n### Amazon Fire OS Quirks\n\nSupports the following `MediaFileData` properties:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Not supported, and returns zero.\n\n- __height__: Supported: image and video files only.\n\n- __width__: Supported: image and video files only.\n\n- __duration__: Supported: audio and video files only\n\n### Android Quirks\n\nSupports the following `MediaFileData` properties:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Not supported, and returns zero.\n\n- __height__: Supported: image and video files only.\n\n- __width__: Supported: image and video files only.\n\n- __duration__: Supported: audio and video files only.\n\n### iOS Quirks\n\nSupports the following `MediaFileData` properties:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Supported on iOS4 devices for audio only. Returns zero for images and videos.\n\n- __height__: Supported: image and video files only.\n\n- __width__: Supported: image and video files only.\n\n- __duration__: Supported: audio and video files only.\n"
}